<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.hzdl.apple.bean.cart.CartItem"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>我的购物车-苹果商城</title>
<link rel="stylesheet" type="text/css" href="${path}/css/css1/style.css">
</head>
<body>
	<!-- start header -->
	<!--end header -->

	<!-- start banner_x -->
	<div class="banner_x center">
		<a href="./index.html" target="_blank"><div class="logo fl"></div></a>

		<div class="wdgwc fl ml40">我的购物车</div>
		<div class="wxts fl ml20">温馨提示：产品是否购买成功，以最终下单为准哦，请尽快结算</div>
		<div class="dlzc fr"></div>
		<div class="clear"></div>
	</div>
	<div class="xiantiao"></div>
	<center>
		<table width="1229px">
			<tr align="center" height="90px">
				<td width="200px" align="left"><input type="checkbox" />全选</td>
				<td width="360px">商品名称</td>
				<td width="200px">单价</td>
				<td width="200px">数量</td>
				<td width="200px">小计</td>
				<td width="200px">操作</td>
			</tr>
			<c:forEach items="${cart}" var="cc">

				<tr align="center" height="85px">
					<td align="left"><input type="checkbox" /><img
						src="${path}/img/imgs/${cc.getGoodsImg()}"
						style="width: 33px; height: 33px" /></td>
					<td style="color: black">${cc.getGoodsName()}${cc.getIPadConn()==null?null:cc.getIPadConn()}&nbsp;&nbsp;${cc.getMacDisc()==null?null:cc.getMacDisc()}
						${cc.getGoodsInch()} ${cc.getGoodsColor()}</td>
					<td style="color: black" ><span id="dan${cc.getCID() }">${cc.getGoodsPrice()}</span>元</td>
					<td><input id="${cc.getCID() }" type="number" value="${cc.getNums() }" step="1" min="1" style="width: 35px;"  onchange="showXiao(this)"/></td>
					<td style="color: black"><span id="xiao${cc.getCID() }" name="w">${cc.getAllPrice()}</span>元</td>
					<td><a
						href="${path}/user/cart/deleteCart?CID=${cc.getCID()}">×</a></td>
				</tr>

			</c:forEach>
		</table>
	</center>
	<script>
		function showXiao(obj) {
			var i = obj.value;
			var o = obj.id;
			var j = document.getElementById("dan" + o).innerHTML;
			document.getElementById("xiao" + o).innerHTML = (i * j);
			showZong()
		}

		function showZong() {
			var i = document.getElementsByName("w");
			var j = 0;
			for (var a = 0; a < i.length; a++) {
				j += i[a].innerHTML * 1;
			}
			document.getElementById("zong").innerHTML = j;
		}

		/* //全选
		function selectOrdetect(obj) {
			var goods = document.getElementsByName("quanxuan");
			if (obj.value == "全选") { //全选
				obj.value = "全不选";

				for (i in goods) {
					var g = goods[i];
					if (g.nodeType == 1) {
						g.setAttribute("checked", "true");

					}
				}

			} else { //全不选
				obj.value = "全选";
				for (i in goods) {
					var g = goods[i];
					if (g.nodeType == 1) {
						g.removeAttribute("checked");
					}
				}
			}
		} */
	</script>


	<div class="jiesuandan mt20 center">
		<div class="tishi fl ml20">
			<ul>
				<li><a href="${path }/home/index">继续购物</a></li>
				<li>|</li>
				<li>共<span>${GoodsNum }</span>件商品，已选择<span>1</span>件
				</li>
				<div class="clear"></div>
			</ul>
		</div>
		<div class="jiesuan fr">

			<div class="jiesuanjiage fl">
				合计（不含运费）：<span id="zong">${AllPrice }</span>
			</div>
			<div class="jsanniu fr" style="margin-right: 40px">
				<a href="${path }/user/order/addOrder"
					style="text-decoration: underline;">去结算</a>
			</div>
			<div class="clear"></div>
		</div>
	</div>



	<!-- footer -->
	<footer class="center">

	<div class="mt20">Apple商城|IOS|米聊|多看书城|苹果路由器|视频电话|苹果天猫店|苹果淘宝直营店|苹果网盟|苹果移动|隐私政策|Select
		Region</div>
	<div>©mi.com 京ICP证110507号 京ICP备10046444号 京公网安备11010802020134号
		京网文[2014]0059-0009号</div>
	<div>违法和不良信息举报电话：185-0130-1238，本网站所列数据，除特殊说明，所有数据均出自我司实验室测试</div>
	</footer>
</body>
</html>
